package de.hwr.sudokuspielehr.demo;

import static org.junit.Assert.fail;

import org.junit.Test;

import de.hwr.sudokuspielehr.ui.Demo;

/**
 * 
 * @author J. Reischauer
 * 
 */
public class TestDemo {

	// unittest for java.awt event queue exception that was thrown occasionally
	@Test
	public void testDemoMoreThanOnce() {
		int amount = 50;

		for (int i = 0; i < amount; i++) {
			testDemo();
		}
	}

	@Test
	public void testDemo() {
		Demo d = null;
		try {
			d = new Demo();
		} catch (Exception e) {
			fail(e.getMessage());
		} finally {
			if (d != null) {
				d.exit();
			}
		}
	}
}
